package com.wowudi.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wowudi.entity.HoPay;
import com.wowudi.entity.OperationRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface OperationRecordMapper extends BaseMapper<OperationRecord> {
    @Select("select * from operation_record opr ,operation_type ot ,patients pt ,sys_user su where opr.hoy_id=ot.hoy_id and opr.pt_id=pt.pt_id and opr.w_id=su.user_id and opr.eq_isdel=0 and (pt.pt_card =#{patiname} or pt.pt_name like CONCAT(CONCAT('%',#{patiname}),'%'))")
    @ResultMap("BaseResultMap")
    Page<OperationRecord> getAllBynameandid(@Param("page")Page<OperationRecord> page, @Param("cartid")String cartid, @Param("patiname")String patiname);
}